﻿using System;
using System.Collections.Generic;
using VisionCloud.Core.Model.Ms;
using VisionCloud.Domain.Common;

namespace VisionCloud.Domain.DtoModel.Ms
{
    /// <summary>
    /// 查询条件对象
    /// </summary>
    public class MsRobotCondition : PageBase
    {
        /// <summary>
        /// 子应用Id
        /// </summary>
        public string AppId { get; set; }

        /// <summary>
        /// 设备Id
        /// </summary>
        public string RobotId { get; set; }

        /// <summary>
        /// 机器人编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public MsRobot.RobotTypeEnum Type { get; set; }

        /// <summary>
        /// 机器人状态
        /// </summary>
        public string StatuName { get; set; }

        /// <summary>
        /// 机器人别名
        /// </summary>
        public string Alias { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedDate { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public Guid CreatedBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? LastUpdatedDate { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        public Guid LastUpdatedBy { get; set; }
    }

    public class MsRobotDto
    {
        /// <summary>
        /// 机器人ID
        /// </summary>
        public string RobotId { get; set; }

        /// <summary>
        /// 机器人Token
        /// </summary>
        public string Token { get; set; }

        /// <summary>
        /// 机器人编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public MsRobot.RobotTypeEnum Type { get; set; }

        /// <summary>
        /// 类型名
        /// </summary>
        public string TypeName { get; set; }

        /// <summary>
        /// 机器人状态
        /// </summary>
        public MsRobot.EnumRobotStatus Status { get; set; }

        /// <summary>
        /// 机器人状态
        /// </summary>
        public string StatuName { get; set; }

        /// <summary>
        /// 机器人别名
        /// </summary>
        public string Alias { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedDate { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public Guid CreatedBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? LastUpdatedDate { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        public Guid LastUpdatedBy { get; set; }

        /// <summary>
        /// 项目Id
        /// </summary>
        public string ProjectId { get; set; }

        /// <summary>
        /// 项目名
        /// </summary>
        public string ProjectName { get; set; }

        /// <summary>
        /// 机器自定义属性列表
        /// </summary>
        public List<RobotAttributeViewModel> Attributes { get; set; }

        public String GetId()
        {
            try
            {
                Random r = new Random();
                string str = "";
                for (int i = 0; i < 18; i++)
                {
                    int a = r.Next(0, 10);
                    str += a.ToString();
                }
                return str;
            }
            catch
            {
                return "";
            }
        }
    }
}